package com.leimingkun.mq.send;

import com.leimingkun.mq.conf.TtlQueueConfig;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping()
public class RabbitSend {
    @Autowired
    private RabbitTemplate rabbitTemplate;
    @GetMapping("/t")
    public void test(){
        rabbitTemplate.convertAndSend(TtlQueueConfig.BUSINESS_EXCHANGE,
                TtlQueueConfig.BUSINESS_ROUTING_KEY,"hello world");
    }
}
